$(document).ready(function() {
	
	$("#accordion").accordion({
		header : "h3"

	});

	$('#tabs1').tabs();
	$('#tabs2').tabs();
	$('#tabs3').tabs();
	$('#tabs4').tabs();
	$('#searchTab').tabs();
	$('#tabs1').show();
	$('#tabs2').hide();
	$('#tabs3').hide();
	$('#tabs4').hide();
	$('#searchTab').hide();

	$('#firstEvent').click(function() {
		$('#tabs1').show();
		$('#tabs2').hide();
		$('#tabs3').hide();
		$('#tabs4').hide();
		$('#searchTab').hide();
	});

	$('#secondEvent').click(function() {
		$('#tabs1').hide();
		$('#tabs2').show();
		$('#tabs3').hide();
		$('#tabs4').hide();
		$('#searchTab').hide();

	});

	$('#thirdEvent').click(function() {
		$('#tabs1').hide();
		$('#tabs2').hide();
		$('#tabs3').show();
		$('#tabs4').hide();
		$('#searchTab').hide();
	});

	$('#fourthEvent').click(function() {
		$('#tabs1').hide();
		$('#tabs2').hide();
		$('#tabs3').hide();
		$('#tabs4').show();
		$('#searchTab').hide();
	});
	
	
	

	$('#input').focusin(function() {
		$(this).css('color', "black");
	});
	$('#input').focusout(function() {
		$(this).css('color', "#c0c0c0");
	});

	// Switching between tabs using menu links

	var $tabs1 = $('#tabs1').tabs(); // first tab selected

	$('#myprofile').click(function() { // bind click event to link
		$tabs1.tabs('select', 0); // switch to First tab
		return false;
	});
	
	
	

	var $tabs2 = $('#tabs2').tabs(); // first tab selected

	$('#employees').click(function() { // bind click event to link
		$tabs2.tabs('select', 0); // switch to first tab
		return false;
	});
	
	$('#projects').click(function() { // bind click event to link
		$tabs2.tabs('select', 1); // switch to First tab
		return false;
	});
	
	$('#assignprojects').click(function() { // bind click event to link
		$tabs2.tabs('select', 2); // switch to Second tab
		return false;
	});
	

	var $tabs3 = $('#tabs3').tabs(); // first tab selected

	$('#newtraining').click(function() { // bind click event to link
		$tabs3.tabs('select', 0); // switch to first tab
		return false;
	});
	$('#assigntraining').click(function() { // bind click event to link
		$tabs3.tabs('select', 1); // switch to second tab
		return false;
	});

	var $tabs4 = $('#tabs4').tabs(); // first tab selected

	$('#friends').click(function() { // bind click event to link
		$tabs4.tabs('select', 0); // switch to first tab
		return false;
	});
	$('#status').click(function() { // bind click event to link
		$tabs4.tabs('select', 1); // switch to second tab
		return false;
	});
	$('#photos').click(function() { // bind click event to link
		$tabs4.tabs('select', 2); // switch to first tab
		return false;
	});
	$('#likes').click(function() { // bind click event to link
		$tabs4.tabs('select', 3); // switch to second tab
		return false;
	});

	$('#tabs3').tabs({
		load : function(event, ui) {
			$('a', ui.panel).click(function() {
				$(ui.panel).load(this.href);
				return false;
			});
		}
	});
	
	$(function() {
		$( "#datepicker" ).datepicker();
	});
	
	
	
});